<?php if(isset($user)): ?>

<!--USER DETAILS AND ADDITIONAL STUFF-->
<div id="info-left">
    <table>
        <tr>
            <td>Username:</td>
            <td><?php echo $user['details']->username; ?></td>
        </tr>
        <tr>
            <td>Country:</td>
            <td><?php echo $user['details']->country; ?></td>
        </tr>
        <tr>
            <td>Recipes:</td>
            <td><?php echo $user['details']->drinks; ?></td>
        </tr>
    </table>
</div>
<!--USER AVATAR AND USELESS STUFF-->
<div id="info-right">
    <div id="avatar">
        <?php echo img(base_url() . $user['details']->avatar); ?>
    </div>
    <div id="user-drinks">
        <?php 
            foreach ($user['drinks'] as $drink){
                echo '<span class="img drink_img">';
                /**
                 * @todo (Lukas) We use <<img/>> here since we do not want to store the image folder
                 * in the database just because that name and or location might change.
                 * It would be a good idea to store to path to the image folder somewhere in the config 
                 * or define a constant. Something that prevents us having to rewrite tons of occurences
                 * of <<img/>> in our code.
                 * 
                 * $this->config->item('xyz'); might be a good idea, similar to the stuff the tank_auth
                 * author did.
                 */
                echo anchor('/drink/details/' . $drink->id, img(base_url() . 'img/' . $drink->image_path), '');
                echo '</span>';
                echo '<br>';
            }
        ?>
    </div>
</div>
<?php else: ?>
    <div class="alert alert-error">
        Sorry, we can't show you any more details.
    </div>
<?php endif; ?>

